package com.ganbo.ms.nio.group;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.Socket;

/**
 * @author ganbo
 * @date 2022/11/24 23:12
 */
public class BioClient2 {

    public static void main(String[] args) throws IOException, InterruptedException {
        Socket socket = new Socket("127.0.0.1", 6666);
        OutputStream outputStream = socket.getOutputStream();
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(outputStream));
        while (true) {
            Thread.sleep(1000);

            bw.write("hello ");

            bw.flush();
        }


    }
}

